//
//  ITTImageWallView.h
//  AiTuPianPad
//
//  Created by guo hua on 11-9-20.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ITTImageWallItem.h"
@class ITTImageWallView;

@protocol ITTImageWallViewDataSource
-(NSInteger)numberOfImageOnWall:(ITTImageWallView *)view;//总数
-(NSInteger)numberOfViewPerRowForWall:(ITTImageWallView *)view;//每排个数
-(ITTImageWallItem *)imageWallView:(ITTImageWallView *)view viewAtIndex:(NSInteger )index;//view
-(CGFloat)rowHightOfWallView:(ITTImageWallView *)view;//一排的高度
@optional
-(CGFloat)imageWallView:(ITTImageWallView *)view paddingHightOfRow:(NSInteger )row;//
-(CGFloat)imageWallView:(ITTImageWallView *)view leftPaddingOfRow :(NSInteger )row;
-(CGFloat)imageWallView:(ITTImageWallView *)view paddingWidthOfRow:(NSInteger )row;
-(CGSize )imageWallView:(ITTImageWallView *)view viewSizeInRow:(NSInteger )row;
@end

@protocol ITTImageWallViewDelegate
- (void)imageWallView:(ITTImageWallView *)wallView didselectAtIndex:(NSInteger)index;
@end

@interface ITTImageWallView : UIScrollView<UIScrollViewDelegate,ITTImageViewDelegate>{
    id<ITTImageWallViewDelegate> _wallDelegate;
    id<ITTImageWallViewDataSource> _wallDataSource;
    NSMutableSet *_visibleViews;
    NSMutableSet *_recycledViews;
    
    NSInteger numberPerRow;
    NSInteger itemCount;
    CGFloat rowHight;
    UIViewContentMode imageContentMode;
    ITTImageResizeType resizeType;
    NSRange _visibleRange;
    NSRange _staticRange;
}
@property(nonatomic,assign)id<ITTImageWallViewDelegate> wallDelegate;
@property(nonatomic,assign)id<ITTImageWallViewDataSource> wallDataSource;
@property(nonatomic,assign)UIViewContentMode imageContentMode;
@property(nonatomic,assign)ITTImageResizeType resizeType;
-(void)reloadData;
-(void)refreshView;
-(void)showEmpty:(BOOL)show;
-(void)showLoading:(BOOL)show;
-(ITTImageWallItem *)dequeueReusableItemWithIdentifier:(NSString *)identifier;
@end
